package org.osgroup.service;

import org.osgroup.project.FoodStreet;
import org.osgroup.project.Restaurant;
import org.springframework.stereotype.Service;

import jakarta.annotation.PostConstruct;

/**
 * 美食街服务
 */
@Service
public class FoodStreetService {
    
    private FoodStreet foodStreet;
    
    @PostConstruct
    public void init() {
        // 初始化美食街
        // 参数: bufferCapacity=10(餐品缓冲区), orderQueueSize=10(订单队列)
        foodStreet = new FoodStreet("美食街");
        foodStreet.initializeAndOpen(10, 10);
        
        System.out.println("✅ 美食街服务已初始化");
    }
    
    public FoodStreet getFoodStreet() {
        return foodStreet;
    }
    
    public Restaurant getRestaurant(String restaurantId) {
        return foodStreet.getRestaurant(restaurantId);
    }
}
